package com.hyf.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.junit.Before;
import org.springframework.stereotype.Component;


public class Myaspect {
    public void before(){
        System.out.println("before");
    }
    public void after(){
        System.out.println("后置通知");
    }
    public Object around(ProceedingJoinPoint joinPoint)throws Throwable{
        Object[] args=joinPoint.getArgs();
        System.out.println("环绕");
        Object proceed = joinPoint.proceed(args);
        System.out.println("环绕通知");
        return proceed;
    }
    public void afterThrowing(Exception e){
        System.out.println("异常");
    }
    public void afterReturning(Object result){
        System.out.println("返回");
    }
}
